<?php
session_start();

//echo $_SESSION["MAPA_PATH_"]; exit;

require($_SESSION["MAPA_PATH_"]."config.php");

require($_SESSION["MAPA_PATH_"]."./lang/lang.pt.php");
require($_SESSION["MAPA_PATH_"]."functions.php");


if (!$_REQUEST["pdatai"]){
	//$pdatai = date("d/m/Y");
	$pdatai = date("d/m/Y", mktime(0, 0, 0, date("m")  ,  date("d")-3,  date("y"))); //inicia o mapa 3 dias antes do dia de hj
}else{
	$pdata_post = ( trim($_REQUEST["pdatai"]) != "" ? trim($_REQUEST["pdatai"]) : date("d/m/Y") );
	list($dia,$mes,$ano)=explode("/",$pdata_post);
	if ($pdata_post == date("d/m/Y")) {
		$pdatai = date("d/m/Y", mktime(0, 0, 0, $mes  ,  $dia-3,  $ano));//inicia o mapa 3 dias antes do dia de hj
	}else {
		$pdatai = $pdata_post;
	}
}

list($d,$m,$y)=explode("/",$pdatai);

$d = (int)$d;
$m = (int)$m;
$y = (int)$y;


$scrollarrows	= scrollArrows($d, $m, $y);
$auth 			= auth();
$_SESSION['authdata'] = array('login'=>"admin", 'password'=>"password", 'userlevel'=>"2", 'uid'=>"1");

/*
echo $auth;
print_r($_SESSION['authdata']);
*/

require($_SESSION["MAPA_PATH_"]."./templates/default.php");
?>
